package com.stadium.common.enums;

public enum DetailEnum {

    场次数("场次数", "CCS","ZCSZ"),

    场次比赛时间("场次比赛时间", "CCBSSJ","ZCSZ"),

    中场休息时间("中场休息时间", "ZCXXSJ","ZCSZ"),

    单个球队的上场人数("单个球队的上场人数", "SCRS","ZCSZ"),

    未知("未知", "WZ","WZ");

    private String code;
    private String name;
    private String category;

    DetailEnum(String name,String code, String category) {
        this.code = code;
        this.name = name;
        this.category = category;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public static DetailEnum getDetailByCode(Integer code) {
        for (DetailEnum detailEnum : DetailEnum.values()) {
            if (code.equals(detailEnum.getCode())) {
                return detailEnum;
            }
        }
        return DetailEnum.未知;
    }

    public static DetailEnum getDetailByName(String name) {
        for (DetailEnum detailEnum : DetailEnum.values()) {
            if (name.equals(detailEnum.getName())) {
                return detailEnum;
            }
        }
        return DetailEnum.未知;
    }
}
